document.addEventListener('DOMContentLoaded', () => {
    const enableRedirectsCheckbox = document.getElementById('enableRedirects');

    chrome.storage.sync.get('enableRedirects', (data) => {
        enableRedirectsCheckbox.checked = data.enableRedirects || false;
    });

    enableRedirectsCheckbox.addEventListener('change', () => {
        chrome.storage.sync.set({ enableRedirects: enableRedirectsCheckbox.checked });
    });
});